using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using WeberTimeTracker.Models.Mapping;
using WeberTimeTracker;

namespace WeberTimeTracker.Models
{
    public class TimeTrackerContext : DbContext
    {
        static TimeTrackerContext()
        {
            Database.SetInitializer<TimeTrackerContext>(null);
        }

		public TimeTrackerContext()
			: base("Name=TimeTrackerContext")
		{
		}

        public DbSet<Address> Addresses { get; set; }
        public DbSet<City> Cities { get; set; }
        public DbSet<Client> Clients { get; set; }
        public DbSet<Contact> Contacts { get; set; }
        public DbSet<Project_Contacts> Project_Contacts { get; set; }
        public DbSet<Project> Projects { get; set; }
        public DbSet<Rate> Rates { get; set; }
        public DbSet<State> States { get; set; }
        public DbSet<Time> Times { get; set; }
        public DbSet<User> Users { get; set; }
        public DbSet<Users_On_Projects> Users_On_Projects { get; set; }
        public DbSet<Zip> Zips { get; set; }
		public DbSet<Users_PTO> Users_PTO { get; set; }
		public DbSet<Submited_PTO> Submitted_PTO { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new AddressMap());
            modelBuilder.Configurations.Add(new CityMap());
            modelBuilder.Configurations.Add(new ClientMap());
            modelBuilder.Configurations.Add(new ContactMap());
            modelBuilder.Configurations.Add(new Project_ContactsMap());
            modelBuilder.Configurations.Add(new ProjectMap());
            modelBuilder.Configurations.Add(new RateMap());
            modelBuilder.Configurations.Add(new StateMap());
            modelBuilder.Configurations.Add(new TimeMap());
            modelBuilder.Configurations.Add(new UserMap());
            modelBuilder.Configurations.Add(new Users_On_ProjectsMap());
            modelBuilder.Configurations.Add(new ZipMap());
			//modelBuilder.Configurations.Add(new PeriodHoursMap());
        }
    }
}
